<?php
include_once 'lib/config.php';
include_once 'lib/db.php';
include_once 'lib/utils/tag.php';
include_once 'model/departemen.php';
//include_once 'dashboard/model/periode.php';
 
function inject_head(){?>
<link rel="stylesheet" type="text/css" href="css/datepicker_vista.css" /> 
<script type="text/javascript" src="jscript/datepicker.js"></script> 
<script>
	function load_graph(){
		if($('totalPointUniversitas').getStyle('display')=='block')
			APP.totalPointUniversitas.load_graph($('totalPointUniversitas-form'));
		if($('rewardPunishmentUniversitas').getStyle('display')=='block')
			APP.rewardPunishmentUniversitas.load_graph($('rewardPunishmentUniversitas-form'));
	}
	
	function load_drillGraph(data){
		if(APP.graphCombo.oldSelected.id == 'totalPointUniversitas')
			APP.totalPointUniversitas.load_drillGraph(data);	
		else if(APP.graphCombo.oldSelected.id == 'rewardPunishmentUniversitas')
			APP.rewardPunishmentUniversitas.load_drillGraph(data);	
	}
	
	
	APP = {
		graphCombo: {
			oldSelected: null
		}	
	};
	
	window.addEvent('domready', function(){
		APP.graphCombo.oldSelected = $('totalPointUniversitas');
		
		$('graphCombo').addEvent('change', function(){
			if (APP.graphCombo.oldSelected){
				APP.graphCombo.oldSelected.setStyle('display','none');
			}
			
			APP.graphCombo.oldSelected = $( $('graphCombo').value );
			APP.graphCombo.oldSelected.setStyle('display','block');
			load_graph();
		});	
		
		load_graph();
	});
</script>
<?php } ?>

<?php include 'view/header.php'; ?>
<h2>Grafik Overview</h2>
<hr />
<table width="100%" border="0">
<tr>
	<td width="100" align="right">Grafik : </td>
    <td>
    <select id="graphCombo" name="graphCombo" onchange="">
    	<option value="totalPointUniversitas">Total Point Perguruan Tinggi</option>
    	<option value="rewardPunishmentUniversitas">Reward Punishment Perguruan Tinggi</option>
    </select></td>
</tr>
</table>
<div id="totalPointUniversitas"><?php include 'view/admin/dashboard/totalPointUniversitas.php'; ?></div>
<div id="rewardPunishmentUniversitas" style="display: none;"><?php include 'view/admin/dashboard/rewardPunishmentUniversitas.php'; ?></div>

<div align="center" id="graphContainer" style="margin-top:20px">
<img id="graph" src="proc/admin/totalPointUniversitas.php?proc=graph" />
</div>

<?php include 'view/footer.php'; ?>